package com.woniuxy.simple;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: 曾令忠
 * @Description: 生产者，负责向消息队列发送消息
 * @Date: 2020/7/4 0004-下午 4:08
 */
@Component
public class Productor {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(){
        //参数1：队列名
        //参数2：内容
        rabbitTemplate.convertAndSend("hello","hello啊饭已Ok了，快点下来咪西吧");
    }
}
